#define  _CRT_SECURE_NO_WARNINGS  1
#include <stdio.h>
int DigitSum(int num)
{
	if (num > 9)
		return num % 10 + DigitSum(num / 10);
	else return num;
}
int main()
{
	int n = 0;
	scanf("%d", &n);
	int ret = DigitSum(n);
	printf("%d", ret);

	return 0;
}